# Contributor: Alex Yam <alex@alexyam.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=xcb-imdkit
pkgver=1.0.9
pkgrel=0
pkgdesc="X input method support for XCB"
url="https://github.com/fcitx/xcb-imdkit"
arch="all"
license="LGPL-2.1-only"
makedepends="
	cmake
	extra-cmake-modules
	samurai
	uthash-dev
	xcb-util-keysyms-dev
	"
subpackages="$pkgname-dev"
source="https://github.com/fcitx/xcb-imdkit/archive/$pkgver/xcb-imdkit-$pkgver.tar.gz"

build() {
	CFLAGS="$CFLAGS -flto=auto" \
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DUSE_SYSTEM_UTHASH=ON
	cmake --build build
}

check() {
	ctest -VV --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
d1c188f86401d69a571de8dca37e752a61125ee9096c45cabdbf0fd89bf78ffdd79e1ea8c2097b51488d387bd9159caee891bf34d57b1ddbb9d8f106433eadd8  xcb-imdkit-1.0.9.tar.gz
"
